/*
 * Group 3, User Interface Programming II (vt11)
 * Pooya | Flora | Monica | Can
 */
package vical.view;

import java.awt.Color;
import javax.swing.JCheckBox;
import vical.model.Internationalization;

/**
 * The special CheckBox only for Priority displaying
 * 
 * @author Can
 */
public class PriorityCheckBox extends JCheckBox {

    private String priority;

    public PriorityCheckBox(String priority, boolean isSelected) {
        super(priority, isSelected);
        this.priority = priority;
        this.setPriorityText();
        this.setColor();
        this.setOpaque(false);
    }

    private void setPriorityText() {
        if (this.priority == "Normal") {
            this.setText(Internationalization.getString("calendar_priority_normal"));
        } else if (this.priority == "High") {
            this.setText(Internationalization.getString("calendar_priority_high"));
        }
    }

    private void setColor() {
        if (this.priority == "Normal") {
            this.setForeground(Color.BLUE);
        } else if (this.priority == "High") {
            this.setForeground(Color.RED);
        }
    }

    public String getPriority() {
        return priority;
    }
}
